

int w;
int h;
int y;
int x;
int i = 1;
boolean released = false;


void setup(){

  size(400,400);
  noStroke();
  fill(40,100,20);
  rectMode(CENTER);
  

}

void draw(){

  background(255);
  
  if(mousePressed && released == true){
    
      x = mouseX;
      y = mouseY; 

    }
    
     Rectangle r1 = new Rectangle(x,y,w,h);
   
  }


    



void mouseReleased(){
  
  w = mouseX;
  h = mouseY;
  
  released = true;
  i++;
}



class Rectangle{
    

    Rectangle(int _x, int _y, int _w, int _h)
    {
      
      x = _x;
      y = _y;
      w = _w;
      h = _h;
      
      rect(x,y,w,h);
    }

}


/*

  (int _x, int _y, int _w, int _h)

    x = _x;
    y = _y;
    w = _w;
    h = _h;
  

*/
